package com.zdxlz.fcmp.business.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zdxlz.fcmp.common.mybatis.enums.DeviceTypeEnum;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import static com.zdxlz.fcmp.common.core.constant.ParameterVerifyMsgConstants.*;

/**
 * <p>
 * 设备信息表
 * </p>
 *
 * @author: aman
 * @since 2025-02-08
 */
@Data
@TableName("device_info")
public class DeviceInfoEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 设备主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 宽带账号
     */
    @TableField("account")
    private String account;

    /**
     * 企业名称
     */
    @NotBlank(message = MERCHANTNAME_VERIFY_MSG)
    @TableField("merchant_name")
    private String merchantName;

    /**
     * 企业信息，包含名称、联系人、地址等信息，已JSON存储
     */
    @TableField("merchant_info")
    private String merchantInfo;

    /**
     * 设备mac
     */
    @NotBlank(message = MAC_VERIFY_MSG)
    @TableField("mac")
    private String mac;

    /**
     * 厂家
     */
    @NotBlank(message = CORPORATION_VERIFY_MSG)
    @TableField("corporation")
    private String corporation;

    /**
     * 型号
     */
    @NotBlank(message = MODEL_VERIFY_MSG)
    @TableField("model")
    private String model;

    /**
     * 固件版本
     */
    @NotBlank(message = FWVERSION_VERIFY_MSG)
    @TableField("fw_version")
    private String fwVersion;

    /**
     * 组件版本
     */
    @TableField("cp_version")
    private String cpVersion;

    /**
     * 营业执照名称
     */
    @TableField("business_license")
    private String businessLicense;

    /**
     * 信用代码
     */
    @TableField("credit_code")
    private String creditCode;

    /**
     * 审计厂家
     */
    @TableField("audit")
    private String audit;

    /**
     * 省
     */
    @NotBlank(message = DEVICEPROVINCE_VERIFY_MSG)
    @TableField("device_province")
    private String deviceProvince;

    /**
     * 市
     */
    @NotBlank(message = DEVICECITY_VERIFY_MSG)
    @TableField("device_city")
    private String deviceCity;

    /**
     * 区
     */
    @TableField("device_county")
    private String deviceCounty;

    /**
     * 详细地址
     */
    @TableField("device_address")
    private String deviceAddress;

    /**
     * 设备类型，默认：38,31:胖AP,32:GPON,34:EPON,38:FTTR，枚举类：DeviceTypeEnum
     */
    @TableField("type")
    private DeviceTypeEnum type;

    /**
     * 密码资源ID
     */
    @TableField("kms_id")
    private Integer kmsId;

    /**
     * 是否nat
     */
    @TableField("nat_flag")
    private Boolean natFlag;


    /**
     * nat是需要配置的地址
     */
    @TableField("nat_wan_ip")
    private String natWanIp;

    /**
     * 是否匿名配置IPSec
     */
    @TableField("anonymous_flag")
    private Boolean anonymousFlag;

    /**
     * IPSec序列号默认值110
     */
    @NotNull(message = IPSECINDEX_VERIFY_MSG)
    @TableField("ipsec_index")
    private Integer ipsecIndex;

    /**
     * 设备保护内网地址网段
     */
    @TableField("protected_subnet")
    private String protectedSubnet;

    /**
     * 设备wan口地址
     */
    @TableField("wan_ip")
    private String wanIp;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;
}
